<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        <input type="hidden" value="{$row.users_id}" name="users_id">
<!--        <input type="hidden" value="{$row.template_id}" name="template_id"  >-->
       <input type="hidden" value="{$row.qr_user_id}" name="qr_user_id"  >
        <input type="hidden" value="{$row.qr_id}" name="qr_user_id"  >
        <div class="layui-form-item layui-form-text">
<!--            <label class="layui-form-label"></label>-->
<!--            <div class="layui-input-block">-->
                <textarea name="content" class="layui-textarea"  placeholder="请输入追评内容" autocomplete="off"></textarea>
<!--            </div>-->
        </div>
        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm"  lay-submit lay-filter="sub">确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>
<style>
    .layui-layer-setwin a {
        position: absolute;
        width: 32px;
        height: 40px;
        _overflow: hidden;
        top: -28px;
    }
</style>
<script>
    //表单追加评价
    layui.use([ 'element', 'jquery', 'laydate', 'form'],function() {
        var $ = layui.jquery;
        var element = layui.element;
        var laydate = layui.laydate;
        var form = layui.form;
        //监听提交事件
        form.on('submit(sub)', function(data){
            // console.log(data);return false;
            var fields=$(data.form).serializeArray();// serialize
            var ret = true;
            var msg = '';
            $.each(fields, function(index, value) {
                // alert(index + ': ' + value.name);

                if(value.name == "content" && value.value == ''){
                    ret = false;
                    msg = '请进行文字评价';
                    return false;
                }
            });
            if(ret == false){
                layer.msg(msg);return false;
            }
            //使用ajax发送请求
            $.ajax({
                url:"/api/evaluation.zhuiping/addReview",
                type:"post",
                data:fields,
                dataType:"json",
                success:function(data){
                    // $("[name='content']").val('');
                    layer.msg(data.msg);
                    //window.location = './myinfo.html'
                    // 关闭窗口
                    var index = parent.layer.getFrameIndex(window.name); //获取当前窗口的name
                    parent.layer.close(index);//关闭窗口
                }
            });
            return false;  //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>